<?php
include_once "TransactionalInterface.php";
class Transaction implements TransactionalInterface {
	
	private $inTransaction;
	private $mysqlConn;
	
	public function __construct(){
		$this->inTransaction = false;
	}
	
	function inTransaction() {
		return $this->inTransaction;
	}
	
	
	
	function startTransaction() {
		if (is_null($this->mysqlConn))
			$this->mysqlConn=new MyDB();
		$this->inTransaction = true;
	}
	
	function closeTransaction() {
		if ($this->inTransaction) {
			if (!is_null($this->mysqlConn))
				$this->mysqlConn->closeConn();
		}
		
		$this->inTransaction = false;
	}
	
	function getMySQLConn() {
		return $this->mysqlConn;
	}
	
	
	
	function rollback(){
		
	}
	
}
?>